package com.cfswt.tasksystem.mapper;

import com.cfswt.tasksystem.pojo.dto.*;
import com.cfswt.tasksystem.pojo.entity.IndicatorDetailScheme;
import com.cfswt.tasksystem.pojo.entity.IndicatorDetailTask;
import com.cfswt.tasksystem.pojo.entity.IndicatorTaskBookAttachment;
import com.cfswt.tasksystem.pojo.vo.*;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface KPIMapper {

    int insertKPI(KPIPartyReleaseDTO kpiPartyReleaseDTO);

    List<KPIPartyListVO> selectKPIListVO();

    KPIPartyVO selectKPIPartyVOById(Integer id);

    //一级指标
    int insertPrimaryIndicator(PrimaryIndicatorDTO primaryIndicatorDTO);

    List<PrimaryIndicatorVO> selectPrimaryIndicatorByKPIId(int id);

    int deletePrimaryIndicatorByKpiId(Integer kpiId);

    int insertPrimaryIndicatorPlan(PrimaryIndicatorPlanDTO primaryIndicatorPlanDTO);

    List<PrimaryIndicatorPlanVO> selectPrimaryIndicatorPlanByKPIId(int id);

    int deletePrimaryIndicatorPlanByKpiId(Integer kpiId);

    int insertCustomPrimaryIndicatorPlan(CustomPrimaryIndicatorPlanDTO customPrimaryIndicatorPlanDTO);

    List<CustomPrimaryIndicatorPlanVO> selectCustomPrimaryIndicatorPlanByKPIId(int id);

/*    int updateIndicatorDetailEndTimeById(Integer id);*/
    int updateCustomPrimaryIndicatorPlanById(CustomPrimaryIndicatorPlanDTO customPrimaryIndicatorPlanDTO);

    //二级要点
    int insertIndicatorPoint(IndicatorPointDTO indicatorPointDTO);

    List<IndicatorPointVO> selectIndicatorPointsByPrimaryId(int primaryId);

    int deleteIndicatorPointByPrimaryId(Integer primaryId);

    int insertIndicatorPointPlan(IndicatorPointPlanDTO indicatorPointPlanDTO);

    List<IndicatorPointPlanVO> selectIndicatorPointsPlanByPrimaryId(int primaryId);

    int deleteIndicatorPointPlanByPrimaryId(Integer primaryId);

    int insertCustomIndicatorPointPlan(CustomIndicatorPointPlanDTO customIndicatorPointPlanDTO);

    List<CustomIndicatorPointPlanVO> selectCustomIndicatorPointsPlanByPrimaryId(int primaryId);

/*    int updateIndicatorDetailPlanEndTimeById(Integer id);*/
    int updateCustomIndicatorPointPlanById(CustomIndicatorPointPlanDTO customIndicatorPointPlanDTO);

    //详细内容
    int insertIndicatorDetail(IndicatorDetailDTO indicatorDetailDTO);
    List<IndicatorDetailVO> selectIndicatorDetailsByPointId(int pointId);
    int deleteIndicatorDetailByPointId(int pointId);
    int updateIndicatorDetailCompleteById(int id, String complete);

    int insertIndicatorDetailPlan(IndicatorDetailPlanDTO indicatorDetailPlanDTO);
    List<IndicatorDetailPlanVO> selectIndicatorDetailsPlanByPointId(int pointId);
    int deleteIndicatorDetailPlanByPointId(int pointId);
    int updateIndicatorDetailPlanCompleteById(int id, String complete);

    int insertCustomIndicatorDetailPlan(CustomIndicatorDetailPlanDTO customIndicatorDetailPlanDTO);
    List<CustomIndicatorDetailPlanVO> selectCustomIndicatorDetailsPlanByPointId(int pointId);
/*    int updateCustomIndicatorDetailPlanEndTimeById(Integer id);*/
    int updateCustomIndicatorDetailPlanCompleteById(int id, String complete);
    int updateCustomIndicatorDetailPlanById(CustomIndicatorDetailPlanDTO customIndicatorDetailPlanDTO);

    //指标任务
    int insertIndicatorTask(IndicatorDetailTask indicatorDetailTask);

    IndicatorDetailTask selectIndicatorTaskByIds(Integer kpiId, Integer indicatorDetailId);

    int updateIndicatorTask(IndicatorDetailTask indicatorDetailTask);

    //指标任务方案
    int insertDetailScheme(IndicatorDetailScheme indicatorDetailScheme);

    int updateDetailScheme(IndicatorDetailScheme indicatorDetailScheme);

    List<IndicatorDetailScheme> selectDetailSchemeByDetailId(Integer indicatorDetailId);

    List<IndicatorDetailSchemeApprovalVO> selectDetailSchemeByProcessInstanceId(String processInstanceId);

    int updateSchemeStatus(IndicatorDetailSchemeDTO indicatorDetailSchemeDTO);

    int deleteDetailSchemeByDetailId(Integer indicatorDetailId);

    //指标任务发布后更新指标负责人和完成时间
    int updateIndicatorDetailByIds(IndicatorDetailTask indicatorDetailTask);

    int updateIndicatorDetailPlanByIds(IndicatorDetailTask indicatorDetailTask);

    int updateCustomIndicatorDetailPlanByIds(IndicatorDetailTask indicatorDetailTask);


}
